package com.ruoyi.web.controller.websocket;


import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.teaching.domain.WebSocketUserApplication;
import com.ruoyi.teaching.service.WebSocketUserApplicationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李志鑫
 * @since 2024-08-23
 */
@RestController
@RequestMapping("/webSocketUserApplication")
@Api(tags = "webSocket-添加联系人")
public class WebSocketUserApplicationController {
    @Autowired
    private WebSocketUserApplicationService webSocketUserApplicationService;


    @GetMapping("/selectAppliedUser")
    @ApiOperation(value = "查询可以申请的用户", notes = "查询可以申请的用户")
    public AjaxResult selectAppliedUser(Integer pageNum, Integer pageSize,Long schoolId,Long roleId,String message) {
        return webSocketUserApplicationService.selectAppliedUser(pageNum,pageSize,schoolId,roleId,message);
    }



    @PostMapping("/applicationAddUser")
    @ApiOperation(value = "申请添加联系人", notes = "申请添加联系人")
    public AjaxResult applicationAddUser(@RequestBody WebSocketUserApplication webSocketUserApplication) {
        return webSocketUserApplicationService.applicationAddUser(webSocketUserApplication);
    }

    @GetMapping("/selectApplicationAddUser")
    @ApiOperation(value = "查询申请用户", notes = "查询申请用户")
    public AjaxResult selectApplicationAddUser(Integer pageNum, Integer pageSize) {
        return webSocketUserApplicationService.selectApplicationAddUser(pageNum,pageSize);
    }

    @PutMapping("/updateApplicationAddUser")
    @ApiOperation(value = "同意拒绝申请", notes = "同意拒绝申请1不同意2同意")
    public AjaxResult updateApplicationAddUser(@RequestBody WebSocketUserApplication webSocketUserApplication) {
        return webSocketUserApplicationService.updateApplicationAddUser(webSocketUserApplication);
    }


}

